How do I add a column to an existing table. - Mailing list pgsql-general

From John Draper
Subject How do I add a column to an existing table.
Date
Msg-id v03110744b5ead0a07a0f@[24.12.41.181]
Whole thread Raw
Responses Re: How do I add a column to an existing table.
List pgsql-general
I have this table I call "new_users".    The existing first col of that
table is "first_name".     I want to add an additional column in FRONT of
the existing first column of "first_name"...

Existing colums...    first_name | last_name |  <etc>

I want to add...     key | first_name | last_name | <etc>

How is that done,    then I want to automatically insert into "key" a
sequence of numbers like 1,2,3,4,5,6,7,  etc so that each number is
sequentially numbered.

I'm very new to SQL so I suppose this is prolly a pretty dumb question.
The docs on ALTER show how to add a column,   but NOT how to add the column
to the beginning,    or after adding a column,   to re-arrange them so that
the KEY column is first.     Could someone please help me?

I have another related question.    I know it is possible to "Join" tables,
creating a 3rd table.    But can I take this 3rd table and add this table
to my list of tables in my database?      If so,    now do I do that?

John



pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Regression test failures
Next
From: Alfred Perlstein
Date:
Subject: Re: How do I add a column to an existing table.